
#include "stm32f4xx_hal.h"
#include "board.h"
#include "adc1.h"
#include "uart.h"

int main()
{
    HAL_Init();
    SystemClock_Config();
    MX_USART6_UART_Init();
    Adc1Init();
    xprintf("System Initialized !\r\n");

    while (1)
    {
        HAL_Delay(2000);

        uint16_t adc_data[ADC_CHANNEL_NUM];
        Adc1Start();
        Adc1Wait();
        if (Adc1GetData(adc_data) != 0) {
            xprintf("ADC Get Data Error\r\n");
            continue;
        }
        for (int i = 0; i < ADC_CHANNEL_NUM; i++) {
            xprintf("ADC[%d]: %04x\r\n", i, adc_data[i]);
        }
    }

    return 0;
}

void SysTick_Handler(void)
{
    HAL_IncTick();
}

